//=============================================================================================
//Funcoes tela cadastro
//=============================================================================================
function imprime_agenda_init(){
	$('#data_ini').datePicker({startDate:'01/01/1996'});
	$('#data_fim').datePicker({startDate:'01/01/1996'});

}
function openCalendar(campo){
	$(campo).datePicker();
}

function gera_impressao(){

	var data_ini   = document.form.data_ini.value;
	var data_fim   = document.form.data_fim.value;
	
	window.location = "php/agenda/relatorio_compromisso_agenda.php?data_ini="+data_ini+"&data_fim="+data_fim;
	
}


 function formata_data(event,campo){
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13 || keyCode == 8 || keyCode == 46 )
		campo.value = '';
 	if (!(keyCode >= 48 && keyCode <= 57))
  		return false;
	if(campo.value.length == 10)
		return false;
	if(campo.value.length == 2)
		campo.value = campo.value+'/';
	if(campo.value.length == 5)
		campo.value = campo.value+'/';
}
